package com.funtl.spring.cloud.alibaba.provider.service.impl;

import com.funtl.spring.cloud.alibaba.provider.api.ProviderAdminService;
import com.funtl.spring.cloud.alibaba.provider.domain.TbAdmin;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Value;

/**
 * @ClassName ProviderAdminServiceImpl
 * @Description TODO
 * @Author Mr.Starry
 * @Date 2019/12/13 13:57
 * @Version 1.0
 */
@Service(version = "1.0.0")
public class ProviderAdminServiceImpl implements ProviderAdminService {
    /**
     * The default value of ${dubbo.application.name} is ${spring.application.name}
     */
    @Value("${spring.application.name}")
    private String serviceName;

    @Value("${server.port}")
    private String port;

    @Value("${dubbo.protocol.port}")
    private String dubbo_port;

    @Override
    public TbAdmin sayHello(String str) {
        TbAdmin tbAdmin = new TbAdmin();
        tbAdmin.setUsername(str+"，来自"+"Dubbo RPC:"+dubbo_port+"-HTTP:"+port+"的回复"+"，服务提供者名称："+serviceName);
        return tbAdmin;
    }
}
